
exports.test = function() {
    var self = this;

    this.index = function () {
        var result = {
            "title":"cosjs test index",
            "menu":[
                {"url":"/test/baidu","name":"redirect to baidu"},
                {"url":"/test/check","name":"check user login"},
                {"url":"/test/login","name":"test login"},
            ]
        }
        self.display('index',result);
    };

    this.baidu = function () {
        self.redirect('http://www.baidu.com');
    };

    this.check = function(){
        self.session('uid',self.callback);
    }

    this.login = function(){
        var session = self.session();
        var uid = '10015';
        var data = {"a":1,"b":2};
        session.login(uid,data,self.callback);
    }
}